CSS Highlight API: Enable on all channels
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
People
(Reporter: jjaschke, Assigned: jjaschke)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(1 file)
While not being fully feature-complete (text-decoration
and text-shadow
are missing), CSS Highlight API can in its current state already be enabled on all channels.
Assignee | ||
Comment 1•1 month ago
|
||
Comment 2•1 month ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Allows web developers to style ranges.
[Affects Firefox for Android]: yes
[Suggested wording]: Added support for the Custom Highlight API, which allows to style text ranges.
[Links (documentation, blog post, etc)]: https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
Comment 4•27 days ago
|
||
bugherder |
Comment 5•24 days ago
|
||
Thanks, added to the Fx140 nightly release notes, please allow 30 minutes for the site to update.
Keeping the relnote-firefox flag as ? to keep it on the radar for inclusion in the final Fx140 release notes.
Comment 6•5 days ago
|
||
The priority
property does not seem to be respected on CSS Highlight API
https://developer.mozilla.org/en-US/docs/Web/API/Highlight/priority
I have tested in:
- Chrome 136 - works as expected
- Safari 18.5 - works as expected
- Firefox Beta 140 - only respects the last highlight created
- Firefox Nightly 141 - only respects the last highlight created
This is my test CodePen - https://codepen.io/CodeRedDigital/pen/QwbbqoG?editors=1010
Assignee | ||
Comment 7•5 days ago
|
||
Hi Dave, thanks for your report. Let's move this to Bug 1968981.
Comment 8•5 days ago
|
||
The .add
method of the CSS Highlight API can not be chained.
I have tried the following in the console:
const highlight = new Highlight();
const range1 = new Range();
const range2 = new Range();
highlight.add(range1).add(range2);
console.log(highlight.size); // 2
I have tested in:
- Chrome 136 - works as expected
- Safari 18.5 - works as expected
- Firefox Beta 140 - does not work
- Firefox Nightly 141 - does not work
Adding separately does work:
const highlight = new Highlight();
const range1 = new Range();
const range2 = new Range();
highlight.add(range1);
highlight.add(range2);
console.log(highlight.size); // 2
Assignee | ||
Comment 9•5 days ago
|
||
Please file separate issues for this and needinfo me on them, please. I've filed Bug 1969004.
(Really appreciate your efforts though, thank you!)
Comment 10•5 days ago
|
||
(In reply to Jan Jaeschke [:jjaschke] from comment #9)
Please file separate issues for this and needinfo me on them, please. I've filed Bug 1969004.
(Really appreciate your efforts though, thank you!)
Understood, thank you
Updated•5 days ago
|
Description
•